﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net;
using System.Net.Mail;
using System.Configuration;
using System.IO;

namespace TimeManagementSystem
{
    public class MailSender
    {

        private void SendEmail(string mailTo, string subject, string body)
        {
            try
            {
                var mail = new MailMessage(ConfigurationManager.AppSettings.Get("email"), mailTo, subject, body);
                var client = new SmtpClient(ConfigurationManager.AppSettings.Get("emailSMTP"), Convert.ToInt32(ConfigurationManager.AppSettings.Get("emailPort")));
                client.EnableSsl = true;
                client.Credentials = new NetworkCredential(ConfigurationManager.AppSettings.Get("email"), ConfigurationManager.AppSettings.Get("passEmail"));
                client.DeliveryMethod = SmtpDeliveryMethod.Network;
                client.Send(mail);
                mail.Dispose();
            }
            catch (Exception ex)
            {
                throw new Exception("Mail.Send: " + ex.Message);
            }
        }

        private string GetEmailBodyTemplate(string fileName)
        {
            return null;
        }

        public void RegisterUserSendEmail(string userName, string userSname, string userEmail, string login)
        {

        }

        public void GoalCreatedSendEmail(string userName, string userSname, string userEmail, string goalName)
        {
            
        }

        public void TaskCreatedSendEmail(string userName, string userSname, string userEmail, Task task, string goalName)
        {
            
        }

        public void TaskAssignedToSendEmail(string userName, string userSname, string userEmail, Task task, string goalName)
        {
            
        }

        public void TaskStatusChangedSendEmail(string userName, string userSname, string userEmail, Task task, string goalName)
        {
            
        }

        public void BugCreatedSendEmail(string userName, string userSname, string userEmail, Task task, Bug bug)
        {
            
        }

        public void BugStatusChangedSendEmail(string userName, string userSname, string userEmail, Task task, Bug bug)
        {
            
        }
    }
}